<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/integer/form_field_integer_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class VPage_Template_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_name = $form->get_field('name');
		$f_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_name->get_name(), $f_name);
		$this->add_field_view('name', $f_name_view);

		$f_wp_path = $form->get_field('wp_path');
		$f_wp_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_wp_path->get_name(), $f_wp_path);
		$this->add_field_view('wp_path', $f_wp_path_view);

		$f_wp_class_name = $form->get_field('wp_class_name');
		$f_wp_class_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_wp_class_name->get_name(), $f_wp_class_name);
		$this->add_field_view('wp_class_name', $f_wp_class_name_view);

		$f_page_name = $form->get_field('page_name');
		$f_page_name_view = new Form_Field_Text_View($form->get_name().'_'.$f_page_name->get_name(), $f_page_name);
		$this->add_field_view('page_name', $f_page_name_view);

		$f_edit_path = $form->get_field('edit_path');
		$f_edit_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_edit_path->get_name(), $f_edit_path);
		$this->add_field_view('edit_path', $f_edit_path_view);

		$f_man_path = $form->get_field('man_path');
		$f_man_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_man_path->get_name(), $f_man_path);
		$this->add_field_view('man_path', $f_man_path_view);

		$f_del_path = $form->get_field('del_path');
		$f_del_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_del_path->get_name(), $f_del_path);
		$this->add_field_view('del_path', $f_del_path_view);

		$f_cache = $form->get_field('cache');
		$f_cache_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_cache->get_name(), $f_cache);
		$this->add_field_view('cache', $f_cache_view);

		$f_cache_expiry = $form->get_field('cache_expiry');
		$f_cache_expiry_view = new Form_Field_Integer_View($form->get_name().'_'.$f_cache_expiry->get_name(), $f_cache_expiry);
		$this->add_field_view('cache_expiry', $f_cache_expiry_view);

		$f_hard_cache = $form->get_field('hard_cache');
		$f_hard_cache_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_hard_cache->get_name(), $f_hard_cache);
		$this->add_field_view('hard_cache', $f_hard_cache_view);

		$f_update = $form->get_field('update');
		$f_update_view = new Form_Field_Checkbox_View($form->get_name().'_'.$f_update->get_name(), $f_update);
		$this->add_field_view('update', $f_update_view);
	}
}